package org.atovio.eh.pojo;

import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

/**
 * @author AtoVio, Winter Yuan
 */
@Data
public class Order {
    @NotBlank(message = "商品名不能为空")
    private String name;

    @NotNull(message = "商品数量不能为空")
    @Range(min = 1, max = 99, message = "数量只能在{min}~{max}之间")
    private Integer amount;

    @NotNull(message = "id不能为空")
    @Min(value = 1, message = "id最小为1")
    private Integer id;
}
